using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace BootyBay.Models.Mapping
{
    public class AppWhiteListMap : EntityTypeConfiguration<AppWhiteList>
    {
        public AppWhiteListMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            // Table & Column Mappings
            this.ToTable("AppWhiteList");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Id_ApplicationInfo).HasColumnName("Id_ApplicationInfo");
            this.Property(t => t.TimeStamp).HasColumnName("TimeStamp");

            // Relationships
            this.HasRequired(t => t.ApplicationInfo)
                .WithMany(t => t.AppWhiteLists)
                .HasForeignKey(d => d.Id_ApplicationInfo);

        }
    }
}
